<template>
  <!-- 课题详情 -->
  <el-form :model="dialogForm">
    <el-form-item
      label="课题可选范围："
      :rules="rules"
      label-width="200px"
      prop="topicScope"
    >
      <el-input
        placeholder="课题可选范围"
        v-model="dialogForm.topicScope"
        autocomplete="off"
        style="width: 480px"
        :readonly="true"
        hide-required-asterisk="false"
      ></el-input>
    </el-form-item>
    <el-form-item label="课题可选专业：" :rules="rules" label-width="200px">
      <el-input
        placeholder="课题可选专业"
        v-model="dialogForm.topicMajor"
        autocomplete="off"
        style="width: 480px"
        :readonly="true"
      ></el-input>
    </el-form-item>
    <el-form-item label="课题标题：" :rules="rules" label-width="200px">
      <el-input
        placeholder="课题标题"
        v-model="dialogForm.topicName"
        autocomplete="off"
        style="width: 480px"
        :readonly="readonly"
      ></el-input>
    </el-form-item>
    <el-form-item label="课题简介：" :rules="rules" label-width="200px">
      <el-input
        placeholder="课题简介"
        type="textarea"
        v-model="dialogForm.topicIntroduction"
        autocomplete="off"
        style="width: 480px"
        :rows="8"
      ></el-input>
    </el-form-item>
    <el-form-item
      label="课题要求(包括所具备的条件)："
      :rules="rules"
      label-width="200px"
    >
      <el-input
        placeholder="课题要求"
        type="textarea"
        v-model="dialogForm.topicRequire"
        autocomplete="off"
        style="width: 480px"
        :rows="8"
      ></el-input>
    </el-form-item>
    <el-form-item label="课题工作量要求：" :rules="rules" label-width="200px">
      <el-input
        placeholder="课题工作量要求"
        type="textarea"
        v-model="dialogForm.topicWorkloadRequire"
        autocomplete="off"
        style="width: 480px"
        :rows="8"
      ></el-input>
    </el-form-item>
    <el-form-item label="课题性质：" :rules="rules" label-width="200px">
      <el-radio-group v-model="dialogForm.topicNature" style="width: 480px">
        <el-radio label="理论研究" name="type"></el-radio>
        <el-radio label="应用研究" name="type"></el-radio>
        <el-radio label="开发研究" name="type"></el-radio>
        <el-radio label="工程设计" name="type"></el-radio>
        <el-radio label="实验研究" name="type"></el-radio>
        <el-radio label="综合性研究" name="type"></el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="课题来源：" :rules="rules" label-width="200px">
      <el-radio-group v-model="dialogForm.topicSource" style="width: 360px">
        <el-radio
          label="A、教师已立项科研课题(纵向与横向)"
          name="type"
        ></el-radio>
        <el-radio
          label="B、结合企业和社会生产实践的课题"
          name="type"
        ></el-radio>
        <el-radio label="C、自行设计课题" name="type"></el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="第二指导老师：" :rules="rules" label-width="200px">
      <el-input
        placeholder="第二指导老师"
        v-model="dialogForm.secondGuideTeacher"
        autocomplete="off"
        style="width: 480px"
      ></el-input>
    </el-form-item>
    <el-form-item
      label="论文研究方向："
      :rules="rules"
      label-width="200px"
      prop="thesisDirection"
    >
      <el-input
        placeholder="论文研究方向"
        v-model="dialogForm.thesisDirection"
        autocomplete="off"
        style="width: 480px"
      ></el-input>
    </el-form-item>
    <div class="sub-title" style="float: right; margin: -20px 40px 0 0">
      8/数据范围：0~17
    </div>
    <div
      class="sub-title"
      style="color: red; margin: 30px 40px 20px 200px; font-weight: 700"
    >
      每个研究方向最多8个汉字，最多写两个，以中英文分号分隔，总数不超过17个汉字。
    </div>
    <el-form-item
      label="是否专业第一届毕业生："
      :rules="rules"
      label-width="200px"
    >
      <el-radio-group v-model="dialogForm.firstGraduate">
        <el-radio label="是"></el-radio>
        <el-radio label="否"></el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item
      label="上传论文（设计）类型："
      :rules="rules"
      label-width="200px"
    >
      <el-radio-group v-model="dialogForm.thesisType">
        <el-radio label="毕业论文"></el-radio>
        <el-radio label="毕业设计"></el-radio>
        <el-radio label="涉密论文"></el-radio>
        <el-radio label="无"></el-radio>
      </el-radio-group>
    </el-form-item>
  </el-form>
</template>

<script>
export default {
  props: ['messages', 'changeInput'],

  data() {
    return {
      // 课题详情信息
      dialogForm: {
        topicScope: '',
        topicMajor: '',
        topicName: '',
        topicIntroduction: '',
        topicRequire: '',
        topicWorkloadRequire: '',
        topicNature: '',
        topicSource: '',
        secondGuideTeacher: '',
        thesisDirection: '',
        firstGraduate: '',
        thesisType: '',
      },

      // 是否不能修改输入框里的内容
      readonly: true,
    };
  },

  mounted() {
    this.dialogForm.topicScope = this.messages.major;
    this.dialogForm.topicMajor = this.messages.major;
    this.dialogForm.topicName = this.messages.topicName;
    if (this.changeInput === false) {
      this.readonly = this.changeInput;
    }
  },
};
</script>

<style lang="less" scoped>
.el-radio {
  display: inline-block;
  margin: 10px;
}
</style>
